(()=>{"use strict";var e,t={36035:(e,t,n)=>{n(65677);var a=n(56930),l=w(n(79674));n(47309);var r=w(n(66694)),o=n(96403),i=w(n(55046)),d=n(64524),u=w(n(49981)),c=w(n(43741)),s=w(n(73268)),f=w(n(22794)),h=w(n(69626)),p=w(n(9242)),g=w(n(45244)),m=w(n(82628)),v=w(n(18862)),y=w(n(48580));function w(e){return e&&e.__esModule?e:{default:e}}function b(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function S(e,t){var n,a,l,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))){n&&(e=n);var a=0,l=function(){};return{s:l,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw r}}}}(document.cookie.split("; "));try{for(r.s();!(n=r.n()).done;){var o=(a=n.value.split("="),l=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,l,r,o,i=[],d=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(a=r.call(n)).done)&&(i.push(a.value),i.length!==t);d=!0);}catch(e){u=!0,l=e}finally{try{if(!d&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return i}}(a,l)||b(a,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],d=o[1];if("Scr1wCTFdLanguage"===i)return"en"===decodeURIComponent(d)?e:t}}catch(e){r.e(e)}finally{r.f()}return t}function E(e,t){var n=e.data,a=(0,l.default)("#result-message"),o=(0,l.default)("#result-notification"),i=(0,l.default)("#submission-input");o.removeClass(),a.text(n.message),"authentication_required"!==n.status?("incorrect"===n.status?(o.addClass("alert alert-danger alert-dismissable text-center"),o.slideDown(),i.removeClass("correct"),i.addClass("wrong"),setTimeout((function(){i.removeClass("wrong")}),3e3)):"correct"===n.status?(o.addClass("alert alert-success alert-dismissable text-center"),o.slideDown(),(0,l.default)(".challenge-solves").text(parseInt((0,l.default)(".challenge-solves").text().split(" ")[0])+1+S(" Solves","人解出")),i.val(""),i.removeClass("wrong"),i.addClass("correct")):"already_solved"===n.status?(o.addClass("alert alert-info alert-dismissable text-center"),o.slideDown(),i.addClass("correct")):"paused"===n.status?(o.addClass("alert alert-warning alert-dismissable text-center"),o.slideDown()):"ratelimited"===n.status&&(o.addClass("alert alert-warning alert-dismissable text-center"),o.slideDown(),i.addClass("too-fast"),setTimeout((function(){i.removeClass("too-fast")}),3e3)),setTimeout((function(){(0,l.default)(".alert").slideUp(),(0,l.default)("#challenge-submit").removeClass("disabled-button"),(0,l.default)("#challenge-submit").prop("disabled",!1)}),3e3),t&&t(n)):window.location=r.default.config.urlRoot+"/login?next="+r.default.config.urlRoot+window.location.pathname+window.location.hash}function _(e){r.default._internal.challenge={},l.default.getScript(r.default.config.urlRoot+e.scripts.view,(function(){var t=e.create;(0,l.default)("#create-chal-entry-div").html(t),(0,d.bindMarkdownEditors)(),l.default.getScript(r.default.config.urlRoot+e.scripts.create,(function(){(0,l.default)("#create-chal-entry-div form").submit((function(e){e.preventDefault();var t=(0,l.default)("#create-chal-entry-div form").serializeJSON();r.default.fetch("/api/v1/challenges",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){return e.json()})).then((function(e){if(e.success)(0,l.default)("#challenge-create-options #challenge_id").val(e.data.id),(0,l.default)("#challenge-create-options").modal();else{var t="";for(var n in e.errors)t+=e.errors[n].join("\n"),t+="\n";(0,o.ezAlert)({title:S("Error","错误"),body:t,button:S("OK","好的")})}}))}))}))}))}function A(e){e.preventDefault();var t=(0,l.default)(e.target).serializeJSON(!0),n={challenge_id:t.challenge_id,content:t.flag||"",type:t.flag_type,data:t.flag_data?t.flag_data:""};Promise.all([new Promise((function(e,t){0!=n.content.length?r.default.fetch("/api/v1/flags",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(t){e(t.json())})):e()})),new Promise((function(n,a){var r=e.target,o={challenge:t.challenge_id,type:"challenge"};(0,l.default)(r.elements.file).val()&&i.default.files.upload(r,o),n()}))]).then((function(e){r.default.fetch("/api/v1/challenges/"+t.challenge_id,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({state:t.state})}).then((function(e){return e.json()})).then((function(e){e.success&&setTimeout((function(){window.location=r.default.config.urlRoot+"/admin/challenges/"+t.challenge_id}),700)}))}))}(0,l.default)((function(){if((0,l.default)(".preview-challenge").click((function(e){r.default._internal.challenge={},l.default.get(r.default.config.urlRoot+"/api/v1/challenges/"+window.CHALLENGE_ID,(function(e){var t=e.data;t.solves=null,l.default.getScript(r.default.config.urlRoot+t.type_data.scripts.view,(function(){var n=r.default._internal.challenge;n.data=e.data,(0,l.default)("#challenge-window").empty(),n.preRender(),(0,l.default)("#challenge-window").append(t.view),(0,l.default)("#challenge-window #challenge-input").addClass("form-control"),(0,l.default)("#challenge-window #challenge-submit").addClass("btn btn-md btn-outline-secondary float-right"),(0,l.default)(".challenge-solves").hide(),(0,l.default)(".nav-tabs a").click((function(e){e.preventDefault(),(0,l.default)(this).tab("show")})),(0,l.default)("#challenge-window").on("hide.bs.modal",(function(e){(0,l.default)("#challenge-input").removeClass("wrong"),(0,l.default)("#challenge-input").removeClass("correct"),(0,l.default)("#incorrect-key").slideUp(),(0,l.default)("#correct-key").slideUp(),(0,l.default)("#already-solved").slideUp(),(0,l.default)("#too-fast").slideUp()})),(0,l.default)(".load-hint").on("click",(function(e){var t;t=(0,l.default)(this).data("hint-id"),r.default.api.get_hint({hintId:t,preview:!0}).then((function(e){if(e.data.content)return t=e.data,void(0,o.ezAlert)({title:S("Hint","提示"),body:t.html,button:S("Got it!","明白了")});var t}))})),(0,l.default)("#challenge-submit").click((function(e){e.preventDefault(),(0,l.default)("#challenge-submit").addClass("disabled-button"),(0,l.default)("#challenge-submit").prop("disabled",!0),r.default._internal.challenge.submit(!0).then(E)})),(0,l.default)("#challenge-input").keyup((function(e){13==e.keyCode&&(0,l.default)("#challenge-submit").click()})),n.postRender(),(0,l.default)("#challenge-window").find("pre code").each((function(e){y.default.highlightBlock(this)})),window.location.replace(window.location.href.split("#")[0]+"#preview"),(0,l.default)("#challenge-window").modal()}))}))})),(0,l.default)(".comments-challenge").click((function(e){(0,l.default)("#challenge-comments-window").modal()})),(0,l.default)(".delete-challenge").click((function(e){(0,o.ezQuery)({title:S("Delete Challenge","删除题目"),body:S("Are you sure you want to delete {0}","你确定要删除{0}").format("<strong>"+(0,a.htmlEntities)(window.CHALLENGE_NAME)+"</strong>"),success:function(){r.default.fetch("/api/v1/challenges/"+window.CHALLENGE_ID,{method:"DELETE"}).then((function(e){return e.json()})).then((function(e){e.success&&(window.location=r.default.config.urlRoot+"/admin/challenges")}))}})})),(0,l.default)("#challenge-update-container > form").submit((function(e){e.preventDefault();var t=(0,l.default)(e.target).serializeJSON(!0);r.default.fetch("/api/v1/challenges/"+window.CHALLENGE_ID+"/flags",{method:"GET",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then((function(e){return e.json()})).then((function(e){var n=function(){r.default.fetch("/api/v1/challenges/"+window.CHALLENGE_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){return e.json()})).then((function(e){if(e.success){switch((0,l.default)(".challenge-state").text(e.data.state),e.data.state){case"visible":(0,l.default)(".challenge-state").removeClass("badge-danger").addClass("badge-success");break;case"hidden":(0,l.default)(".challenge-state").removeClass("badge-success").addClass("badge-danger")}(0,o.ezToast)({title:S("Success","成功"),body:S("Your challenge has been updated!","题目已更新！")})}else{var t="";for(var n in e.errors)t+=e.errors[n].join("\n"),t+="\n";(0,o.ezAlert)({title:S("Error","错误"),body:t,button:S("OK","好的")})}}))};0===e.data.length&&"visible"===t.state?(0,o.ezQuery)({title:S("Missing Flags","缺少FLag"),body:S("This challenge does not have any flags meaning it may be unsolveable. Are you sure you'd like to update this challenge?(If using dynamic_docker, ignore)","此题目没有任何Flag，这意味着它可能无法解答。 您确定要更新此挑战吗？（如果使用dynamic_docker，请忽略）"),success:n}):n()}))})),(0,l.default)("#challenge-create-options form").submit(A),document.querySelector("#challenge-flags")){var e=u.default.extend(s.default),t=document.createElement("div");document.querySelector("#challenge-flags").appendChild(t),new e({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(t)}if(document.querySelector("#challenge-topics")){var n=u.default.extend(h.default),i=document.createElement("div");document.querySelector("#challenge-topics").appendChild(i),new n({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(i)}if(document.querySelector("#challenge-tags")){var d=u.default.extend(p.default),w=document.createElement("div");document.querySelector("#challenge-tags").appendChild(w),new d({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(w)}if(document.querySelector("#prerequisite-add-form")){var b=u.default.extend(f.default),C=document.createElement("div");document.querySelector("#prerequisite-add-form").appendChild(C),new b({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(C)}if(document.querySelector("#challenge-files")){var j=u.default.extend(g.default),D=document.createElement("div");document.querySelector("#challenge-files").appendChild(D),new j({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(D)}if(document.querySelector("#challenge-hints")){var O=u.default.extend(m.default),x=document.createElement("div");document.querySelector("#challenge-hints").appendChild(x),new O({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(x)}if(document.querySelector("#next-add-form")){var L=u.default.extend(v.default),T=document.createElement("div");document.querySelector("#next-add-form").appendChild(T),new L({propsData:{challenge_id:window.CHALLENGE_ID}}).$mount(T)}if(document.querySelector("#comment-box")){var I=u.default.extend(c.default),k=document.createElement("div");document.querySelector("#comment-box").appendChild(k),new I({propsData:{type:"challenge",id:window.CHALLENGE_ID}}).$mount(k)}l.default.get(r.default.config.urlRoot+"/api/v1/challenges/types",(function(e){var t=e.data;_(t.standard),(0,l.default)("#create-chals-select input[name=type]").change((function(){_(t[this.value])}))}))}))},65677:(e,t,n)=>{var a=h(n(66694)),l=h(n(79674)),r=h(n(71350));n(76528),n(47585);var o=h(n(90146)),i=h(n(82786)),d=n(54830),u=h(n(90840)),c=h(n(40710)),s=h(n(64524)),f=h(n(55046));function h(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}r.default.extend(o.default),"en"===function(e){var t,n,a,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))){n&&(e=n);var a=0,l=function(){};return{s:l,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw r}}}}(document.cookie.split("; "));try{for(l.s();!(t=l.n()).done;){var r=(n=t.value.split("="),a=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,l,r,o,i=[],d=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(a=r.call(n)).done)&&(i.push(a.value),i.length!==t);d=!0);}catch(e){u=!0,l=e}finally{try{if(!d&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return i}}(n,a)||p(n,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];if("Scr1wCTFdLanguage"===o)return decodeURIComponent(i)}}catch(e){l.e(e)}finally{l.f()}return null}()?r.default.locale("en"):r.default.locale("zh-cn"),a.default.init(window.init),window.CTFd=a.default,window.helpers=f.default,window.$=l.default,window.dayjs=r.default,window.nunjucks=i.default,window.Howl=d.Howl,(0,l.default)((function(){(0,s.default)(),(0,c.default)(),(0,u.default)(a.default.config.urlRoot)}))}},n={};function a(e){var l=n[e];if(void 0!==l)return l.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return t[e](r,r.exports,a),r.loaded=!0,r.exports}a.m=t,e=[],a.O=(t,n,l,r)=>{if(!n){var o=1/0;for(c=0;c<e.length;c++){for(var[n,l,r]=e[c],i=!0,d=0;d<n.length;d++)(!1&r||o>=r)&&Object.keys(a.O).every((e=>a.O[e](n[d])))?n.splice(d--,1):(i=!1,r<o&&(o=r));if(i){e.splice(c--,1);var u=l();void 0!==u&&(t=u)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,l,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=963,(()=>{var e={963:0,671:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var l,r,[o,i,d]=n,u=0;if(o.some((t=>0!==e[t]))){for(l in i)a.o(i,l)&&(a.m[l]=i[l]);if(d)var c=d(a)}for(t&&t(n);u<o.length;u++)r=o[u],a.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return a.O(c)},n=self.webpackChunkctfd=self.webpackChunkctfd||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var l=a.O(void 0,[160,736,694],(()=>a(36035)));l=a.O(l)})();